/*******************************************************************************
 * Copyright (c) 2013 INTERAMERICAN PROPERTY AND CASUALTY INSURANCE COMPANY S.A. 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v3
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/copyleft/lesser.html
 * 
 * This library is distributed in the hope that it will be useful, 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 * See the GNU Lesser General Public License for more details.
 ******************************************************************************/
package gr.interamerican.bo2.creation;

/**
 * NameResolver provides a mechanism that can figure out the name of a
 * class that implements an interface and vice versa.
 * 
 * There can be different implementations of NameResolver according
 * to the conventions used in a project. Those naming conventions 
 * provide a convenience that will allow to avoid mapping of each
 * interface declaration to the corresponding implementation type.
 */
public interface NameResolver {

	/**
	 * It resolves an Implementation class name to an Interface class name.
	 * 
	 * The implementation type is generated by replacing the def package
	 * of the interface with the impl package and by adding an Impl postfix.
	 * Example: com.foo.def.SomeType resolves to com.foo.impl.SomeTypeImpl.
	 * If the interface name does not include the interface package, then
	 * the the method will return the interface name.
	 * 
	 * @param interfaceName
	 *            the interface class name
	 * @return the implementation class name
	 * 
	 */
	public String getImplementationName(String interfaceName);

	/**
	 * It resolves an Interface class name to an Implementation class name.
	 * 
	 * The implementation type is generated by replacing the def package
	 * of the interface with the impl package and by adding an Impl postfix.
	 * So in order to resolve the interface name, the process is reversed.
	 * Example: com.foo.impl.SomeTypeImpl resolves to com.foo.def.SomeType.
	 * 
	 * @param implementationName
	 *            the implementation class name
	 * @return the interface class name
	 * 
	 */
	public String getDeclarationName(String implementationName);

}
